 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKNc/NcModel.h>

@implementation Logs
-(id) initWithContent:(NSString*) content { 
     self.content = content;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self content])
    {
        [result setValue:[self content] forKey:@"content"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.content = [dictionary objectForKey:@"content"];
    return self;
}
 @end
@implementation SecurityGroupSimple
-(id) initWithGroupId:(NSString*) groupId
      groupName:(NSString*)groupName { 
     self.groupId = groupId;               
     self.groupName = groupName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self groupId])
    {
        [result setValue:[self groupId] forKey:@"groupId"];
    }
    if([self groupName])
    {
        [result setValue:[self groupName] forKey:@"groupName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.groupId = [dictionary objectForKey:@"groupId"];
    self.groupName = [dictionary objectForKey:@"groupName"];
    return self;
}
 @end
@implementation NetworkInterfacePrivateIp
-(id) initWithPrivateIpAddress:(NSString*) privateIpAddress
      elasticIpId:(NSString*)elasticIpId
      elasticIpAddress:(NSString*)elasticIpAddress { 
     self.privateIpAddress = privateIpAddress;               
     self.elasticIpId = elasticIpId;               
     self.elasticIpAddress = elasticIpAddress;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self privateIpAddress])
    {
        [result setValue:[self privateIpAddress] forKey:@"privateIpAddress"];
    }
    if([self elasticIpId])
    {
        [result setValue:[self elasticIpId] forKey:@"elasticIpId"];
    }
    if([self elasticIpAddress])
    {
        [result setValue:[self elasticIpAddress] forKey:@"elasticIpAddress"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.privateIpAddress = [dictionary objectForKey:@"privateIpAddress"];
    self.elasticIpId = [dictionary objectForKey:@"elasticIpId"];
    self.elasticIpAddress = [dictionary objectForKey:@"elasticIpAddress"];
    return self;
}
 @end
@implementation LogOption
-(id) initWithKey:(NSString*) key
      value:(NSString*)value { 
     self.key = key;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.key = [dictionary objectForKey:@"key"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation HostAlias
-(id) initWithHostnames:(NSArray<NSString*>*) hostnames
      ip:(NSString*)ip { 
     self.hostnames = hostnames;               
     self.ip = ip;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self hostnames])
    {
        [result setValue:[self hostnames] forKey:@"hostnames"];
    }
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.hostnames = [dictionary objectForKey:@"hostnames"];
    self.ip = [dictionary objectForKey:@"ip"];
    return self;
}
 @end
@implementation InstanceCloudDisk
-(id) initWithDiskId:(NSString*) diskId
      az:(NSString*)az
      name:(NSString*)name
      descriptionValue:(NSString*)descriptionValue
      diskType:(NSString*)diskType
      diskSize:(NSNumber*)diskSize
      status:(NSString*)status
      createTime:(NSString*)createTime { 
     self.diskId = diskId;               
     self.az = az;               
     self.name = name;               
     self.descriptionValue = descriptionValue;               
     self.diskType = diskType;               
     self.diskSize = diskSize;               
     self.status = status;               
     self.createTime = createTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self diskSize])
    {
        [result setValue:[self diskSize] forKey:@"diskSize"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskId = [dictionary objectForKey:@"diskId"];
    self.az = [dictionary objectForKey:@"az"];
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.diskSize = [dictionary objectForKey:@"diskSize"];
    self.status = [dictionary objectForKey:@"status"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    return self;
}
 @end
@implementation NcQuota
-(id) initWithResourceType:(NSString*) resourceType
      limit:(NSNumber*)limit
      used:(NSNumber*)used { 
     self.resourceType = resourceType;               
     self.limit = limit;               
     self.used = used;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self limit])
    {
        [result setValue:[self limit] forKey:@"limit"];
    }
    if([self used])
    {
        [result setValue:[self used] forKey:@"used"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.limit = [dictionary objectForKey:@"limit"];
    self.used = [dictionary objectForKey:@"used"];
    return self;
}
 @end
@implementation EnvVar
-(id) initWithName:(NSString*) name
      value:(NSString*)value { 
     self.name = name;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation NetworkInterfaceSpec
-(id) initWithSubnetId:(NSString*) subnetId
      az:(NSString*)az
      primaryIpAddress:(NSString*)primaryIpAddress
      secondaryIpAddresses:(NSArray<NSString*>*)secondaryIpAddresses
      secondaryIpCount:(NSNumber*)secondaryIpCount
      securityGroups:(NSArray<NSString*>*)securityGroups
      sanityCheck:(NSNumber*)sanityCheck
      descriptionValue:(NSString*)descriptionValue { 
     self.subnetId = subnetId;               
     self.az = az;               
     self.primaryIpAddress = primaryIpAddress;               
     self.secondaryIpAddresses = secondaryIpAddresses;               
     self.secondaryIpCount = secondaryIpCount;               
     self.securityGroups = securityGroups;               
     self.sanityCheck = sanityCheck;               
     self.descriptionValue = descriptionValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self primaryIpAddress])
    {
        [result setValue:[self primaryIpAddress] forKey:@"primaryIpAddress"];
    }
    if([self secondaryIpAddresses])
    {
        [result setValue:[self secondaryIpAddresses] forKey:@"secondaryIpAddresses"];
    }
    if([self secondaryIpCount])
    {
        [result setValue:[self secondaryIpCount] forKey:@"secondaryIpCount"];
    }
    if([self securityGroups])
    {
        [result setValue:[self securityGroups] forKey:@"securityGroups"];
    }
    if([self sanityCheck])
    {
        [result setValue:[self sanityCheck] forKey:@"sanityCheck"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.az = [dictionary objectForKey:@"az"];
    self.primaryIpAddress = [dictionary objectForKey:@"primaryIpAddress"];
    self.secondaryIpAddresses = [dictionary objectForKey:@"secondaryIpAddresses"];
    self.secondaryIpCount = [dictionary objectForKey:@"secondaryIpCount"];
    self.securityGroups = [dictionary objectForKey:@"securityGroups"];
    self.sanityCheck = [dictionary objectForKey:@"sanityCheck"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    return self;
}
 @end
@implementation DockerRegistryData
-(id) initWithServer:(NSString*) server
      username:(NSString*)username
      password:(NSString*)password
      email:(NSString*)email { 
     self.server = server;               
     self.username = username;               
     self.password = password;               
     self.email = email;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self server])
    {
        [result setValue:[self server] forKey:@"server"];
    }
    if([self username])
    {
        [result setValue:[self username] forKey:@"username"];
    }
    if([self password])
    {
        [result setValue:[self password] forKey:@"password"];
    }
    if([self email])
    {
        [result setValue:[self email] forKey:@"email"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.server = [dictionary objectForKey:@"server"];
    self.username = [dictionary objectForKey:@"username"];
    self.password = [dictionary objectForKey:@"password"];
    self.email = [dictionary objectForKey:@"email"];
    return self;
}
 @end
@implementation InstanceNetworkInterface
-(id) initWithNetworkInterfaceId:(NSString*) networkInterfaceId
      macAddress:(NSString*)macAddress
      vpcId:(NSString*)vpcId
      descriptionValue:(NSString*)descriptionValue
      securityGroups:(NSArray<SecurityGroupSimple*>*)securityGroups
      sanityCheck:(NSNumber*)sanityCheck
      primaryIp:(NetworkInterfacePrivateIp*)primaryIp
      secondaryIps:(NSArray<NetworkInterfacePrivateIp*>*)secondaryIps { 
     self.networkInterfaceId = networkInterfaceId;               
     self.macAddress = macAddress;               
     self.vpcId = vpcId;               
     self.descriptionValue = descriptionValue;               
     self.securityGroups = securityGroups;               
     self.sanityCheck = sanityCheck;               
     self.primaryIp = primaryIp;               
     self.secondaryIps = secondaryIps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self networkInterfaceId])
    {
        [result setValue:[self networkInterfaceId] forKey:@"networkInterfaceId"];
    }
    if([self macAddress])
    {
        [result setValue:[self macAddress] forKey:@"macAddress"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self securityGroups])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self securityGroups] count]; i++) {
            SecurityGroupSimple* item = [[self securityGroups] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"securityGroups"];
    }
    if([self sanityCheck])
    {
        [result setValue:[self sanityCheck] forKey:@"sanityCheck"];
    }
    if([self primaryIp])
    {
        [result setValue:[[self primaryIp] dictionary]forKey:@"primaryIp"];
    }
    if([self secondaryIps])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self secondaryIps] count]; i++) {
            NetworkInterfacePrivateIp* item = [[self secondaryIps] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"secondaryIps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.networkInterfaceId = [dictionary objectForKey:@"networkInterfaceId"];
    self.macAddress = [dictionary objectForKey:@"macAddress"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    NSArray* securityGroupsArray = [dictionary objectForKey:@"securityGroups"];
    if(securityGroupsArray&&![securityGroupsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [securityGroupsArray count];i++)
        {
            SecurityGroupSimple* item = [[SecurityGroupSimple alloc]initWithDic:[securityGroupsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.securityGroups = propertyArray;
    }
    self.sanityCheck = [dictionary objectForKey:@"sanityCheck"];
    self.primaryIp = [[NetworkInterfacePrivateIp alloc]initWithDic:[dictionary objectForKey:@"primaryIp"]];
    NSArray* secondaryIpsArray = [dictionary objectForKey:@"secondaryIps"];
    if(secondaryIpsArray&&![secondaryIpsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [secondaryIpsArray count];i++)
        {
            NetworkInterfacePrivateIp* item = [[NetworkInterfacePrivateIp alloc]initWithDic:[secondaryIpsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.secondaryIps = propertyArray;
    }
    return self;
}
 @end
@implementation InstanceNetworkInterfaceAttachment
-(id) initWithAutoDelete:(NSNumber*) autoDelete
      deviceIndex:(NSNumber*)deviceIndex
      attachStatus:(NSString*)attachStatus
      attachTime:(NSString*)attachTime
      networkInterface:(InstanceNetworkInterface*)networkInterface { 
     self.autoDelete = autoDelete;               
     self.deviceIndex = deviceIndex;               
     self.attachStatus = attachStatus;               
     self.attachTime = attachTime;               
     self.networkInterface = networkInterface;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self deviceIndex])
    {
        [result setValue:[self deviceIndex] forKey:@"deviceIndex"];
    }
    if([self attachStatus])
    {
        [result setValue:[self attachStatus] forKey:@"attachStatus"];
    }
    if([self attachTime])
    {
        [result setValue:[self attachTime] forKey:@"attachTime"];
    }
    if([self networkInterface])
    {
        [result setValue:[[self networkInterface] dictionary]forKey:@"networkInterface"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.deviceIndex = [dictionary objectForKey:@"deviceIndex"];
    self.attachStatus = [dictionary objectForKey:@"attachStatus"];
    self.attachTime = [dictionary objectForKey:@"attachTime"];
    self.networkInterface = [[InstanceNetworkInterface alloc]initWithDic:[dictionary objectForKey:@"networkInterface"]];
    return self;
}
 @end
@implementation VolumeMount
-(id) initWithCategory:(NSString*) category
      autoDelete:(NSNumber*)autoDelete
      mountPath:(NSString*)mountPath
      readOnly:(NSNumber*)readOnly
      cloudDisk:(InstanceCloudDisk*)cloudDisk
      fsType:(NSString*)fsType { 
     self.category = category;               
     self.autoDelete = autoDelete;               
     self.mountPath = mountPath;               
     self.readOnly = readOnly;               
     self.cloudDisk = cloudDisk;               
     self.fsType = fsType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self category])
    {
        [result setValue:[self category] forKey:@"category"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self mountPath])
    {
        [result setValue:[self mountPath] forKey:@"mountPath"];
    }
    if([self readOnly])
    {
        [result setValue:[self readOnly] forKey:@"readOnly"];
    }
    if([self cloudDisk])
    {
        [result setValue:[[self cloudDisk] dictionary]forKey:@"cloudDisk"];
    }
    if([self fsType])
    {
        [result setValue:[self fsType] forKey:@"fsType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.category = [dictionary objectForKey:@"category"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.mountPath = [dictionary objectForKey:@"mountPath"];
    self.readOnly = [dictionary objectForKey:@"readOnly"];
    self.cloudDisk = [[InstanceCloudDisk alloc]initWithDic:[dictionary objectForKey:@"cloudDisk"]];
    self.fsType = [dictionary objectForKey:@"fsType"];
    return self;
}
 @end
@implementation ElasticIpSpec
-(id) initWithBandwidthMbps:(NSNumber*) bandwidthMbps
      provider:(NSString*)provider
      chargeSpec:(ChargeSpec*)chargeSpec { 
     self.bandwidthMbps = bandwidthMbps;               
     self.provider = provider;               
     self.chargeSpec = chargeSpec;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bandwidthMbps])
    {
        [result setValue:[self bandwidthMbps] forKey:@"bandwidthMbps"];
    }
    if([self provider])
    {
        [result setValue:[self provider] forKey:@"provider"];
    }
    if([self chargeSpec])
    {
        [result setValue:[[self chargeSpec] dictionary]forKey:@"chargeSpec"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bandwidthMbps = [dictionary objectForKey:@"bandwidthMbps"];
    self.provider = [dictionary objectForKey:@"provider"];
    self.chargeSpec = [[ChargeSpec alloc]initWithDic:[dictionary objectForKey:@"chargeSpec"]];
    return self;
}
 @end
@implementation LogConfiguration
-(id) initWithLogDriver:(NSString*) logDriver
      options:(LogOption*)options { 
     self.logDriver = logDriver;               
     self.options = options;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self logDriver])
    {
        [result setValue:[self logDriver] forKey:@"logDriver"];
    }
    if([self options])
    {
        [result setValue:[[self options] dictionary]forKey:@"options"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.logDriver = [dictionary objectForKey:@"logDriver"];
    self.options = [[LogOption alloc]initWithDic:[dictionary objectForKey:@"options"]];
    return self;
}
 @end
@implementation VolumeMountSpec
-(id) initWithCategory:(NSString*) category
      autoDelete:(NSNumber*)autoDelete
      mountPath:(NSString*)mountPath
      readOnly:(NSNumber*)readOnly
      cloudDiskSpec:(DiskSpec*)cloudDiskSpec
      cloudDiskId:(NSString*)cloudDiskId
      fsType:(NSString*)fsType
      formatVolume:(NSNumber*)formatVolume { 
     self.category = category;               
     self.autoDelete = autoDelete;               
     self.mountPath = mountPath;               
     self.readOnly = readOnly;               
     self.cloudDiskSpec = cloudDiskSpec;               
     self.cloudDiskId = cloudDiskId;               
     self.fsType = fsType;               
     self.formatVolume = formatVolume;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self category])
    {
        [result setValue:[self category] forKey:@"category"];
    }
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self mountPath])
    {
        [result setValue:[self mountPath] forKey:@"mountPath"];
    }
    if([self readOnly])
    {
        [result setValue:[self readOnly] forKey:@"readOnly"];
    }
    if([self cloudDiskSpec])
    {
        [result setValue:[[self cloudDiskSpec] dictionary]forKey:@"cloudDiskSpec"];
    }
    if([self cloudDiskId])
    {
        [result setValue:[self cloudDiskId] forKey:@"cloudDiskId"];
    }
    if([self fsType])
    {
        [result setValue:[self fsType] forKey:@"fsType"];
    }
    if([self formatVolume])
    {
        [result setValue:[self formatVolume] forKey:@"formatVolume"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.category = [dictionary objectForKey:@"category"];
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.mountPath = [dictionary objectForKey:@"mountPath"];
    self.readOnly = [dictionary objectForKey:@"readOnly"];
    self.cloudDiskSpec = [[DiskSpec alloc]initWithDic:[dictionary objectForKey:@"cloudDiskSpec"]];
    self.cloudDiskId = [dictionary objectForKey:@"cloudDiskId"];
    self.fsType = [dictionary objectForKey:@"fsType"];
    self.formatVolume = [dictionary objectForKey:@"formatVolume"];
    return self;
}
 @end
@implementation ContainerNetworkInterfaceAttachmentSpec
-(id) initWithAutoDelete:(NSNumber*) autoDelete
      deviceIndex:(NSNumber*)deviceIndex
      networkInterface:(NetworkInterfaceSpec*)networkInterface { 
     self.autoDelete = autoDelete;               
     self.deviceIndex = deviceIndex;               
     self.networkInterface = networkInterface;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self autoDelete])
    {
        [result setValue:[self autoDelete] forKey:@"autoDelete"];
    }
    if([self deviceIndex])
    {
        [result setValue:[self deviceIndex] forKey:@"deviceIndex"];
    }
    if([self networkInterface])
    {
        [result setValue:[[self networkInterface] dictionary]forKey:@"networkInterface"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.autoDelete = [dictionary objectForKey:@"autoDelete"];
    self.deviceIndex = [dictionary objectForKey:@"deviceIndex"];
    self.networkInterface = [[NetworkInterfaceSpec alloc]initWithDic:[dictionary objectForKey:@"networkInterface"]];
    return self;
}
 @end
@implementation ContainerSpec
-(id) initWithInstanceType:(NSString*) instanceType
      az:(NSString*)az
      name:(NSString*)name
      hostAliases:(NSArray<HostAlias*>*)hostAliases
      hostname:(NSString*)hostname
      command:(NSArray<NSString*>*)command
      args:(NSArray<NSString*>*)args
      envs:(NSArray<EnvVar*>*)envs
      image:(NSString*)image
      secret:(NSString*)secret
      tty:(NSNumber*)tty
      workingDir:(NSString*)workingDir
      rootVolume:(VolumeMountSpec*)rootVolume
      dataVolumes:(NSArray<VolumeMountSpec*>*)dataVolumes
      elasticIp:(ElasticIpSpec*)elasticIp
      primaryNetworkInterface:(ContainerNetworkInterfaceAttachmentSpec*)primaryNetworkInterface
      logConfiguration:(LogConfiguration*)logConfiguration
      descriptionValue:(NSString*)descriptionValue
      charge:(ChargeSpec*)charge { 
     self.instanceType = instanceType;               
     self.az = az;               
     self.name = name;               
     self.hostAliases = hostAliases;               
     self.hostname = hostname;               
     self.command = command;               
     self.args = args;               
     self.envs = envs;               
     self.image = image;               
     self.secret = secret;               
     self.tty = tty;               
     self.workingDir = workingDir;               
     self.rootVolume = rootVolume;               
     self.dataVolumes = dataVolumes;               
     self.elasticIp = elasticIp;               
     self.primaryNetworkInterface = primaryNetworkInterface;               
     self.logConfiguration = logConfiguration;               
     self.descriptionValue = descriptionValue;               
     self.charge = charge;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self hostAliases])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self hostAliases] count]; i++) {
            HostAlias* item = [[self hostAliases] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"hostAliases"];
    }
    if([self hostname])
    {
        [result setValue:[self hostname] forKey:@"hostname"];
    }
    if([self command])
    {
        [result setValue:[self command] forKey:@"command"];
    }
    if([self args])
    {
        [result setValue:[self args] forKey:@"args"];
    }
    if([self envs])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self envs] count]; i++) {
            EnvVar* item = [[self envs] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"envs"];
    }
    if([self image])
    {
        [result setValue:[self image] forKey:@"image"];
    }
    if([self secret])
    {
        [result setValue:[self secret] forKey:@"secret"];
    }
    if([self tty])
    {
        [result setValue:[self tty] forKey:@"tty"];
    }
    if([self workingDir])
    {
        [result setValue:[self workingDir] forKey:@"workingDir"];
    }
    if([self rootVolume])
    {
        [result setValue:[[self rootVolume] dictionary]forKey:@"rootVolume"];
    }
    if([self dataVolumes])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataVolumes] count]; i++) {
            VolumeMountSpec* item = [[self dataVolumes] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataVolumes"];
    }
    if([self elasticIp])
    {
        [result setValue:[[self elasticIp] dictionary]forKey:@"elasticIp"];
    }
    if([self primaryNetworkInterface])
    {
        [result setValue:[[self primaryNetworkInterface] dictionary]forKey:@"primaryNetworkInterface"];
    }
    if([self logConfiguration])
    {
        [result setValue:[[self logConfiguration] dictionary]forKey:@"logConfiguration"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self charge])
    {
        [result setValue:[[self charge] dictionary]forKey:@"charge"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.az = [dictionary objectForKey:@"az"];
    self.name = [dictionary objectForKey:@"name"];
    NSArray* hostAliasesArray = [dictionary objectForKey:@"hostAliases"];
    if(hostAliasesArray&&![hostAliasesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [hostAliasesArray count];i++)
        {
            HostAlias* item = [[HostAlias alloc]initWithDic:[hostAliasesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.hostAliases = propertyArray;
    }
    self.hostname = [dictionary objectForKey:@"hostname"];
    self.command = [dictionary objectForKey:@"command"];
    self.args = [dictionary objectForKey:@"args"];
    NSArray* envsArray = [dictionary objectForKey:@"envs"];
    if(envsArray&&![envsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [envsArray count];i++)
        {
            EnvVar* item = [[EnvVar alloc]initWithDic:[envsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.envs = propertyArray;
    }
    self.image = [dictionary objectForKey:@"image"];
    self.secret = [dictionary objectForKey:@"secret"];
    self.tty = [dictionary objectForKey:@"tty"];
    self.workingDir = [dictionary objectForKey:@"workingDir"];
    self.rootVolume = [[VolumeMountSpec alloc]initWithDic:[dictionary objectForKey:@"rootVolume"]];
    NSArray* dataVolumesArray = [dictionary objectForKey:@"dataVolumes"];
    if(dataVolumesArray&&![dataVolumesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataVolumesArray count];i++)
        {
            VolumeMountSpec* item = [[VolumeMountSpec alloc]initWithDic:[dataVolumesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataVolumes = propertyArray;
    }
    self.elasticIp = [[ElasticIpSpec alloc]initWithDic:[dictionary objectForKey:@"elasticIp"]];
    self.primaryNetworkInterface = [[ContainerNetworkInterfaceAttachmentSpec alloc]initWithDic:[dictionary objectForKey:@"primaryNetworkInterface"]];
    self.logConfiguration = [[LogConfiguration alloc]initWithDic:[dictionary objectForKey:@"logConfiguration"]];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.charge = [[ChargeSpec alloc]initWithDic:[dictionary objectForKey:@"charge"]];
    return self;
}
 @end
@implementation Secret
-(id) initWithName:(NSString*) name
      type:(NSString*)type
      createdAt:(NSString*)createdAt
      data:(DockerRegistryData*)data { 
     self.name = name;               
     self.type = type;               
     self.createdAt = createdAt;               
     self.data = data;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self createdAt])
    {
        [result setValue:[self createdAt] forKey:@"createdAt"];
    }
    if([self data])
    {
        [result setValue:[[self data] dictionary]forKey:@"data"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.type = [dictionary objectForKey:@"type"];
    self.createdAt = [dictionary objectForKey:@"createdAt"];
    self.data = [[DockerRegistryData alloc]initWithDic:[dictionary objectForKey:@"data"]];
    return self;
}
 @end
@implementation Container
-(id) initWithContainerId:(NSString*) containerId
      status:(NSString*)status
      instanceType:(NSString*)instanceType
      az:(NSString*)az
      name:(NSString*)name
      hostAliases:(NSArray<HostAlias*>*)hostAliases
      hostname:(NSString*)hostname
      command:(NSArray<NSString*>*)command
      args:(NSArray<NSString*>*)args
      envs:(NSArray<EnvVar*>*)envs
      image:(NSString*)image
      secret:(NSString*)secret
      tty:(NSNumber*)tty
      workingDir:(NSString*)workingDir
      rootVolume:(VolumeMount*)rootVolume
      dataVolumes:(NSArray<VolumeMount*>*)dataVolumes
      vpcId:(NSString*)vpcId
      subnetId:(NSString*)subnetId
      privateIpAddress:(NSString*)privateIpAddress
      elasticIpId:(NSString*)elasticIpId
      elasticIpAddress:(NSString*)elasticIpAddress
      primaryNetworkInterface:(InstanceNetworkInterfaceAttachment*)primaryNetworkInterface
      secondaryNetworkInterfaces:(NSArray<InstanceNetworkInterfaceAttachment*>*)secondaryNetworkInterfaces
      logConfiguration:(LogConfiguration*)logConfiguration
      charge:(Charge*)charge
      launchTime:(NSString*)launchTime
      reason:(NSString*)reason
      descriptionValue:(NSString*)descriptionValue { 
     self.containerId = containerId;               
     self.status = status;               
     self.instanceType = instanceType;               
     self.az = az;               
     self.name = name;               
     self.hostAliases = hostAliases;               
     self.hostname = hostname;               
     self.command = command;               
     self.args = args;               
     self.envs = envs;               
     self.image = image;               
     self.secret = secret;               
     self.tty = tty;               
     self.workingDir = workingDir;               
     self.rootVolume = rootVolume;               
     self.dataVolumes = dataVolumes;               
     self.vpcId = vpcId;               
     self.subnetId = subnetId;               
     self.privateIpAddress = privateIpAddress;               
     self.elasticIpId = elasticIpId;               
     self.elasticIpAddress = elasticIpAddress;               
     self.primaryNetworkInterface = primaryNetworkInterface;               
     self.secondaryNetworkInterfaces = secondaryNetworkInterfaces;               
     self.logConfiguration = logConfiguration;               
     self.charge = charge;               
     self.launchTime = launchTime;               
     self.reason = reason;               
     self.descriptionValue = descriptionValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self containerId])
    {
        [result setValue:[self containerId] forKey:@"containerId"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self hostAliases])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self hostAliases] count]; i++) {
            HostAlias* item = [[self hostAliases] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"hostAliases"];
    }
    if([self hostname])
    {
        [result setValue:[self hostname] forKey:@"hostname"];
    }
    if([self command])
    {
        [result setValue:[self command] forKey:@"command"];
    }
    if([self args])
    {
        [result setValue:[self args] forKey:@"args"];
    }
    if([self envs])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self envs] count]; i++) {
            EnvVar* item = [[self envs] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"envs"];
    }
    if([self image])
    {
        [result setValue:[self image] forKey:@"image"];
    }
    if([self secret])
    {
        [result setValue:[self secret] forKey:@"secret"];
    }
    if([self tty])
    {
        [result setValue:[self tty] forKey:@"tty"];
    }
    if([self workingDir])
    {
        [result setValue:[self workingDir] forKey:@"workingDir"];
    }
    if([self rootVolume])
    {
        [result setValue:[[self rootVolume] dictionary]forKey:@"rootVolume"];
    }
    if([self dataVolumes])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataVolumes] count]; i++) {
            VolumeMount* item = [[self dataVolumes] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataVolumes"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self privateIpAddress])
    {
        [result setValue:[self privateIpAddress] forKey:@"privateIpAddress"];
    }
    if([self elasticIpId])
    {
        [result setValue:[self elasticIpId] forKey:@"elasticIpId"];
    }
    if([self elasticIpAddress])
    {
        [result setValue:[self elasticIpAddress] forKey:@"elasticIpAddress"];
    }
    if([self primaryNetworkInterface])
    {
        [result setValue:[[self primaryNetworkInterface] dictionary]forKey:@"primaryNetworkInterface"];
    }
    if([self secondaryNetworkInterfaces])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self secondaryNetworkInterfaces] count]; i++) {
            InstanceNetworkInterfaceAttachment* item = [[self secondaryNetworkInterfaces] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"secondaryNetworkInterfaces"];
    }
    if([self logConfiguration])
    {
        [result setValue:[[self logConfiguration] dictionary]forKey:@"logConfiguration"];
    }
    if([self charge])
    {
        [result setValue:[[self charge] dictionary]forKey:@"charge"];
    }
    if([self launchTime])
    {
        [result setValue:[self launchTime] forKey:@"launchTime"];
    }
    if([self reason])
    {
        [result setValue:[self reason] forKey:@"reason"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.containerId = [dictionary objectForKey:@"containerId"];
    self.status = [dictionary objectForKey:@"status"];
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.az = [dictionary objectForKey:@"az"];
    self.name = [dictionary objectForKey:@"name"];
    NSArray* hostAliasesArray = [dictionary objectForKey:@"hostAliases"];
    if(hostAliasesArray&&![hostAliasesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [hostAliasesArray count];i++)
        {
            HostAlias* item = [[HostAlias alloc]initWithDic:[hostAliasesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.hostAliases = propertyArray;
    }
    self.hostname = [dictionary objectForKey:@"hostname"];
    self.command = [dictionary objectForKey:@"command"];
    self.args = [dictionary objectForKey:@"args"];
    NSArray* envsArray = [dictionary objectForKey:@"envs"];
    if(envsArray&&![envsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [envsArray count];i++)
        {
            EnvVar* item = [[EnvVar alloc]initWithDic:[envsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.envs = propertyArray;
    }
    self.image = [dictionary objectForKey:@"image"];
    self.secret = [dictionary objectForKey:@"secret"];
    self.tty = [dictionary objectForKey:@"tty"];
    self.workingDir = [dictionary objectForKey:@"workingDir"];
    self.rootVolume = [[VolumeMount alloc]initWithDic:[dictionary objectForKey:@"rootVolume"]];
    NSArray* dataVolumesArray = [dictionary objectForKey:@"dataVolumes"];
    if(dataVolumesArray&&![dataVolumesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataVolumesArray count];i++)
        {
            VolumeMount* item = [[VolumeMount alloc]initWithDic:[dataVolumesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataVolumes = propertyArray;
    }
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.privateIpAddress = [dictionary objectForKey:@"privateIpAddress"];
    self.elasticIpId = [dictionary objectForKey:@"elasticIpId"];
    self.elasticIpAddress = [dictionary objectForKey:@"elasticIpAddress"];
    self.primaryNetworkInterface = [[InstanceNetworkInterfaceAttachment alloc]initWithDic:[dictionary objectForKey:@"primaryNetworkInterface"]];
    NSArray* secondaryNetworkInterfacesArray = [dictionary objectForKey:@"secondaryNetworkInterfaces"];
    if(secondaryNetworkInterfacesArray&&![secondaryNetworkInterfacesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [secondaryNetworkInterfacesArray count];i++)
        {
            InstanceNetworkInterfaceAttachment* item = [[InstanceNetworkInterfaceAttachment alloc]initWithDic:[secondaryNetworkInterfacesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.secondaryNetworkInterfaces = propertyArray;
    }
    self.logConfiguration = [[LogConfiguration alloc]initWithDic:[dictionary objectForKey:@"logConfiguration"]];
    self.charge = [[Charge alloc]initWithDic:[dictionary objectForKey:@"charge"]];
    self.launchTime = [dictionary objectForKey:@"launchTime"];
    self.reason = [dictionary objectForKey:@"reason"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    return self;
}
 @end
 
 


